<template>
  <div class="bg-white">
    <!-- 主体内容区 -->
    <div class="grid grid-cols-4 gap-4 h-[400px]">
      <div v-for="status in irList" :key="status.id" class="w-full">
        <div class="rounded-lg p-4 h-[500px] bg-gray-50">
          <div class="flex items-center justify-between mb-4 sticky top-0">
            <h3 :class="{
              'text-blue-500': status.id === 1,
              'text-yellow-500': status.id === 2,
              'text-green-500': status.id === 3,
              'text-purple-500': status.id === 4,
              'text-gray-500': status.id === 5,
              'text-teal-500': status.id === 6,
              'text-cyan-500': status.id === 7,
              'text-violet-500': status.id === 8,
              'text-rose-500': status.id === 9,
            }" class="font-medium font-bold">{{ status.name }}</h3>
            <span class="text-sm text-gray-500 cursor-pointer hover:text-blue-500" @click="showStatusTasks(status)">{{
              status.count }}个任务</span>
          </div>
          <div class="space-y-2 h-[calc(420px-20px)] overflow-y-auto">
            <div v-for="task in status.task" :key="task.id"
              class="bg-white rounded-lg p-3 shadow-md hover:shadow-xl transition-shadow duration-200 border border-gray-100">
              <div class="flex items-start justify-between group">
                <h4 class="text-sm font-semibold cursor-pointer hover:text-blue-500 leading-6 transition-colors"
                  @click="showTaskDetail(task)">
                  {{ task.title }}
                </h4>
                <el-dropdown trigger="click">
                  <div class="opacity-0 group-hover:opacity-100 transition-opacity">
                    <el-button size="small" class="!rounded-button">
                      <el-icon>
                        <More />
                      </el-icon>
                    </el-button>
                  </div>
                  <!-- 每个卡片的操作按钮 -->
                  <template #dropdown>
                    <el-dropdown-menu>
                      <el-dropdown-item v-for="action in getIrActions(task)" :key="action.name"
                        @click="handleAction(action.name, task)">
                        <span :class="{
                          'text-blue-500': action.type === 'primary',
                          'text-red-500': action.type === 'danger'
                        }">{{ action.label }}</span>
                      </el-dropdown-item>
                    </el-dropdown-menu>
                  </template>
                </el-dropdown>
              </div>
              <div class="mt-2 space-y-1.5">
                <!-- 技术负责人 -->
                <div class="flex flex-wrap gap-2">
                  <span class="text-xs text-gray-500">技术负责人：</span>
                  <el-dropdown trigger="click">
                    <el-tag v-for="name in task.requirementBossName" :key="name" size="small"
                      :type="getMemberTagType(name)" class="!rounded-button cursor-pointer">
                      {{ name }}
                      <el-icon class="ml-1">
                        <ArrowDown />
                      </el-icon>
                    </el-tag>
                    <!-- <template #dropdown>
                        <el-dropdown-menu>
                          <el-dropdown-item v-for="leader in availableLeaders" :key="leader"
                            @click="changeLeader(task.id, leader)">
                            {{ leader }}
                          </el-dropdown-item>
                        </el-dropdown-menu>
                      </template> -->
                  </el-dropdown>
                </div>
                <!-- 研发 -->
                <div class="flex flex-wrap gap-2" v-if="task.requirementRelevances.length > 0">
                  <span class="text-xs text-gray-500">研发：</span>
                  <el-tag v-for="name in task.requirementRelevances" :key="name" size="small"
                    :type="getMemberTagType(name)" class="!rounded-button cursor-pointer"
                    @click="showMemberDetail(name)">
                    {{ name }}
                  </el-tag>
                </div>
                <!-- 测试 -->
                <div class="flex flex-wrap gap-2" v-if="task.contactTestNames.length > 0">
                  <span class="text-xs text-gray-500">测试：</span>
                  <el-tag v-for="name in task.contactTestNames" :key="name" size="small" :type="getMemberTagType(name)"
                    class="!rounded-button cursor-pointer" @click="showMemberDetail(name)">
                    {{ name }}
                  </el-tag>
                </div>
                <!-- 运维 -->
                <div class="flex flex-wrap gap-2" v-if="task.requirementLinuxs.length > 0">
                  <span class="text-xs text-gray-500">运维：</span>
                  <el-tag v-for="name in task.requirementLinuxs" :key="name" size="small" :type="getMemberTagType(name)"
                    class="!rounded-button cursor-pointer" @click="showMemberDetail(name)">
                    {{ name }}
                  </el-tag>
                </div>
              </div>
              <div class="mt-2 flex items-center justify-between text-xs text-gray-500">
                <span>创建时间：{{ task.startDate }} - 结束时间：{{ task.endDate }}</span>
                <span>剩余 {{ task.remainingDays }} 天</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>



    <!-- 分配任务弹窗 -->
    <el-dialog v-model="dialogAvgVisible" :title="dialogTitle" :width="dialogWidth" destroy-on-close>

      <!-- 测试负责人分配测试人员 -->
      <div class="p-4">
        <el-form label-position="top">
          <div v-if="isTimeForm" class="mb-3 bg-gray-50 p-3 rounded-lg">
            <el-form-item label="任务结束时间" class="w-full mb-0">
              <el-date-picker v-model="endTime" type="date" placeholder="选择任务结束时间" style="width: 200px"
                value-format="YYYY-MM-DD" format="YYYY-MM-DD" />
            </el-form-item>
          </div>
          <div v-for="(item, index) in assignItems" :key="index" class="mb-3 bg-gray-50 p-3 rounded-lg">
            <div class="grid grid-cols-7 gap-3">
              <el-form-item label="职能" class="col-span-1 mb-0">
                <el-select v-model="item.role" placeholder="选择职能" class="w-full">
                  <el-option v-for="role in getVoc()" :key="role" :label="role" :value="role" />
                </el-select>
              </el-form-item>
              <el-form-item label="参与人" class="col-span-1 mb-0">
                <el-select v-model="item.participant" filterable placeholder="选择参与人" class="w-full">
                  <el-option v-for="member in availableMembers" :key="member.uuid" :label="member.nickName"
                    :value="member.uuid" />
                </el-select>
              </el-form-item>
              <el-form-item label="预计完成时间" class="col-span-1 mb-0">
                <el-date-picker v-model="item.deadline" type="date" placeholder="选择完成时间" class="w-full"
                  value-format="YYYY-MM-DD" format="YYYY-MM-DD" />
              </el-form-item>
              <el-form-item label="预计耗时(小时)" class="col-span-1 mb-0">
                <el-input-number v-model="item.estimatedHours" :min="1" :max="999" class="w-full"
                  controls-position="right" />
              </el-form-item>
              <el-form-item label="难度评分" class="col-span-2 mb-0">
                <el-rate v-model="item.difficulty" :max="5" :texts="['简单', '较简单', '中等', '较难', '困难']" show-text />
              </el-form-item>
              <div class="flex justify-center items-end" style="align-items:center">
                <el-button type="danger" class="!rounded-button" @click="removeAssignItem(index)"
                  v-if="assignItems.length > 1" size="default">
                  <el-icon class="mr-1">
                    <Delete />
                  </el-icon>
                  删除
                </el-button>
              </div>
            </div>
            <el-form-item label="工作内容" class="mb-0 mt-2">
              <el-input v-model="item.description" type="textarea" :rows="1" placeholder="请简述工作内容" />
            </el-form-item>
          </div>
          <div class="flex justify-center mt-3">
            <el-button type="primary" class="!rounded-button" @click="addAssignItem" size="default">
              <el-icon class="mr-1">
                <Plus />
              </el-icon>
              添加分配项
            </el-button>
          </div>
        </el-form>
      </div>

      <!-- 操作区域 -->
      <template #footer>
        <div class="dialog-footer">
          <el-button type="default" @click="handleCloseAssDialog">取消</el-button>
          <el-button :disabled="!isButton" type="primary" @click="handleConfirmAvg">确定</el-button>
        </div>
      </template>
    </el-dialog>





    <!-- 弹窗组件 -->
    <el-dialog v-model="dialogVisible" :title="dialogTitle" :width="dialogWidth" destroy-on-close>
      <div class="min-h-[200px]">
        <template v-if="dialogType === 'statusTasks'">
          <div class="grid grid-cols-2 gap-4">
            <div v-for="task in currentStatusTasks" :key="task.id"
              class="bg-white rounded-lg p-3 shadow-md hover:shadow-xl transition-shadow duration-200 border border-gray-100">
              <div class="flex items-start justify-between group">
                <h4 class="text-sm font-semibold cursor-pointer hover:text-blue-500 leading-6 transition-colors"
                  @click="showTaskDetail(task)">
                  {{ task.title }}
                </h4>
                <el-dropdown trigger="click">
                  <div class="opacity-0 group-hover:opacity-100 transition-opacity">
                    <el-button size="small" class="!rounded-button">
                      <el-icon>
                        <More />
                      </el-icon>
                    </el-button>
                  </div>
                  <!-- 每个卡片的操作按钮 -->
                  <template #dropdown>
                    <el-dropdown-menu>
                      <el-dropdown-item v-for="action in actions" :key="action.name"
                        @click="handleAction(action.name, task)">
                        <span :class="{
                          'text-blue-500': action.type === 'primary',
                          'text-red-500': action.type === 'danger'
                        }">{{ action.label }}</span>
                      </el-dropdown-item>
                    </el-dropdown-menu>
                  </template>
                </el-dropdown>
              </div>
              <div class="mt-2 space-y-1.5">

                <!-- 技术负责人 -->
                <div class="flex flex-wrap gap-2">
                  <span class="text-xs text-gray-500">技术负责人：</span>
                  <template>
                    <el-dropdown trigger="click">
                      <el-tag v-for="name in task.requirementBossName" :key="name" size="small"
                        :type="getMemberTagType(name)" class="!rounded-button cursor-pointer">
                        {{ name }}
                        <el-icon class="ml-1">
                          <ArrowDown />
                        </el-icon>
                      </el-tag>
                      <template #dropdown>
                        <el-dropdown-menu>
                          <el-dropdown-item v-for="leader in availableLeaders" :key="leader"
                            @click="changeLeader(task.id, leader)">
                            {{ leader }}
                          </el-dropdown-item>
                        </el-dropdown-menu>
                      </template>
                    </el-dropdown>
                  </template>
                </div>

                <!-- 研发 -->
                <div class="flex flex-wrap gap-2">
                  <span class="text-xs text-gray-500">研发：</span>
                  <template>
                    <el-tag v-for="name in task.requirementRelevances" :key="name" size="small"
                      :type="getMemberTagType(name)" class="!rounded-button cursor-pointer"
                      @click="showMemberDetail(name)">
                      {{ name }}
                    </el-tag>
                  </template>
                </div>
                <!-- 测试 -->
                <div v-for="(members, group) in task.requirementBossName" :key="group" class="flex flex-wrap gap-2">
                  <span class="text-xs text-gray-500">{{ group }}：</span>
                  <template v-if="group === '技术负责人'">
                    <el-dropdown trigger="click">
                      <el-tag v-for="member in members" :key="member" size="small" :type="getMemberTagType(member)"
                        class="!rounded-button cursor-pointer">
                        {{ member }}
                        <el-icon class="ml-1">
                          <ArrowDown />
                        </el-icon>
                      </el-tag>
                      <template #dropdown>
                        <el-dropdown-menu>
                          <el-dropdown-item v-for="leader in availableLeaders" :key="leader"
                            @click="changeLeader(task.id, leader)">
                            {{ leader }}
                          </el-dropdown-item>
                        </el-dropdown-menu>
                      </template>
                    </el-dropdown>
                  </template>
                  <template v-else>
                    <el-tag v-for="member in members" :key="member" size="small" :type="getMemberTagType(member)"
                      class="!rounded-button cursor-pointer" @click="showMemberDetail(member)">
                      {{ member }}
                    </el-tag>
                  </template>
                </div>
                <!-- 运维 -->
                <div v-for="(members, group) in task.requirementBossName" :key="group" class="flex flex-wrap gap-2">
                  <span class="text-xs text-gray-500">{{ group }}：</span>
                  <template v-if="group === '技术负责人'">
                    <el-dropdown trigger="click">
                      <el-tag v-for="member in members" :key="member" size="small" :type="getMemberTagType(member)"
                        class="!rounded-button cursor-pointer">
                        {{ member }}
                        <el-icon class="ml-1">
                          <ArrowDown />
                        </el-icon>
                      </el-tag>
                      <template #dropdown>
                        <el-dropdown-menu>
                          <el-dropdown-item v-for="leader in availableLeaders" :key="leader"
                            @click="changeLeader(task.id, leader)">
                            {{ leader }}
                          </el-dropdown-item>
                        </el-dropdown-menu>
                      </template>
                    </el-dropdown>
                  </template>
                  <template v-else>
                    <el-tag v-for="member in members" :key="member" size="small" :type="getMemberTagType(member)"
                      class="!rounded-button cursor-pointer" @click="showMemberDetail(member)">
                      {{ member }}
                    </el-tag>
                  </template>
                </div>
              </div>
              <div class="mt-2 flex items-center justify-between text-xs text-gray-500">
                <span>{{ task.startDate }} - {{ task.endDate }}</span>
                <span>剩余 {{ task.remainingDays }} 天</span>
              </div>
            </div>
          </div>
        </template>
        <template v-else>
          {{ currentTask?.title }}的{{ dialogTitle }}
        </template>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogVisible = false">取消</el-button>
          <el-button type="primary" @click="handleDialogConfirm">
            确认
          </el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
<script lang="ts" setup>
import { ref, onMounted, reactive } from 'vue';
import { postNewInitRequirement, postNewAvgRequirement } from "@/api/newDemands/index";
import { ElMessage } from "element-plus";
import { getRoleUsers } from "@/api/common";
const userAuthId = ref<any>(null); //当前用户权限id
const irList = ref<irBean[]>();
const dialogAvgVisible = ref(false); //控制是否开启分配任务弹窗
const allTestNameOptions = ref(); //所有测试人员列表
const itemRequirementId = ref();//操作需求id
const isButton = ref(true);//防止重复提交

interface irBean {
  id: number | string,
  name: string,
  count: number,
  task: {  // 改为单数形式
    id: number | string,
    title: string,
    requirementBossName: string,
    requirementRelevances: string,
    contactTestNames: string,
    requirementLinuxs: string,
    startDate: string,
    endDate: string,
    remainingDays: number,
  }[]  // 注意这里改为对象数组而不是元组
}


// TODO 新增分配人员行
const endTime = ref('');
const availableMembers = ref<Array<{ nickName: string; uuid: string }>>([]);

interface AssignItem {
  role: string;
  participant: string;
  deadline: string;
  description: string;
  estimatedHours: number;
  difficulty: number;
}
const assignItems = ref<AssignItem[]>([{
  role: '',
  participant: '',
  deadline: '',
  description: '',
  estimatedHours: 8,
  difficulty: 3
}]);
const addAssignItem = () => {
  assignItems.value.push({
    role: '',
    participant: '',
    deadline: '',
    description: '',
    estimatedHours: 8,
    difficulty: 3
  });
};
// TODO 删除分配人员行
const removeAssignItem = (index: number) => {
  assignItems.value.splice(index, 1);
};


// 根据需求状态，返回对应的操作按钮
const getIrActions = (item: any) => {

  if (userAuthId.value == 111) {//测试管理者(也属于测试)
    if (item.requirmentFatherStatus == 1 && item.itemRequirementIsGetTest == 2) {//待分配的需求
      return [
        { name: 'avgTest', label: '分配', type: 'primary' },
      ]
    } else if (item.contactTestNames.length == 0 && item.itemRequirementIsGetTest == 2) {//未分配的所有状态的需求
      return [
        { name: 'avgTest', label: '分配', type: 'primary' },
      ]
    }
    return [
      { name: 'avgTest', label: '分配', type: 'primary' },
    ]
    return
  } else if (userAuthId.value == 222) {//运维人员

  } else if (userAuthId.value == 333) {//项目经理管理者（也属于项目经理）

  } else if (userAuthId.value == 444) {//项目经理

  } else if (userAuthId.value == 555) {//技术负责人（也属于研发）
    if ((item.requirementRelevances.length == 0 || item.requirementLinuxs.length == 0) && item.requirementBossName != "刘涛") {//技术负责人待分配的需求
      return [
        { name: 'avgTest', label: '分配', type: 'primary' },
      ]
    }

  } else if (userAuthId.value == 666) {//测试人员

  } else if (userAuthId.value == 777) {//研发人员

  } else if (userAuthId.value == 888 || userAuthId.value == 999) {//公司管理者（也属于研发）

  } else if (userAuthId.value == 1010) {//售后人员

  }

  return actions
}




// 分配任务
const handleConfirmAvg = async () => {
  isButton.value = false;
  const { data } = await postNewAvgRequirement({
    itemRequirementId: itemRequirementId.value,
    endTime: endTime.value,
    devs: getFunctions("研发"),
    ts: getFunctions("测试"),
    Ms: getFunctions("运维"),
  })
  if (data.code == 200) {
    ElMessage.success(data.msg)
    isButton.value = true;
    GetAllInitRequirement();
    dialogAvgVisible.value = false;
  } else {
    ElMessage.error(data.msg)
    isButton.value = true;
  }
}

// 根据权限获取可以分配的人
const getVoc = () => {
  if (userAuthId.value == 111) {
    return ['测试']
  } else if (userAuthId.value == 555) {
    return ['研发', '运维']
  }
}


// 返回提交的研发测试运维数组
const getFunctions = (itemRole: string) => {
  const functions = assignItems.value.filter((item: any) => item.role == itemRole).map((item: any) => ({
    userUUID: item['participant'],
    guessTime: item.deadline,
    processJob: item.description,
    guessProcess: item.estimatedHours,
    processJobNum: item.difficulty,
  }))

  return functions
}


// 获取全部权限用户
const getAllTestPersion = async (index: string) => {
  const { data } = await getRoleUsers(index);
  if (data.code == 200) {
    const allTestPersion = data.data.map((item: any) => ({
      nickName: item.nickName,
      uuid: item.uuid,
    }))
    availableMembers.value = allTestPersion
    return allTestPersion
  }
  return []
}

// 获取所有我负责的需求
const GetAllInitRequirement = async () => {
  const { data } = await postNewInitRequirement({})
  if (data.code == 200) {
    // 获取所有不同的状态值
    const statusValues = [...new Set(data.data.map((item: any) => item.requirmentFatherStatus))] as string[];

    // 按状态分组
    const irs = statusValues.map(fstatus => {
      // 过滤出当前状态的所有任务
      const tasks = data.data.filter((item: any) => item.requirmentFatherStatus == fstatus);

      // 状态名称映射（根据你的实际业务调整）
      const statusNameMap = {
        '1': '待分配',
        '2': '待开发',
        '3': '开发中',
        '4': '详细设计确认中',
        '5': '测试中',
        '6': '待上线评审',
        '7': '待上线',
        '8': '已上线',
        '9': '已关闭',
      };
      return {
        id: Number(fstatus),
        name: statusNameMap[fstatus as keyof typeof statusNameMap],
        count: tasks.length,
        task: tasks.map((item: any) => (
          {
            id: item.ID,
            title: item.requirementName,
            requirementBossName: item.requirementBossName && item.requirementBossName !== ''
              ? item.requirementBossName.split('|')
              : [],
            requirementRelevances: item.requirementRelevances && item.requirementRelevances !== ''
              ? item.requirementRelevances.split('|')
              : [],
            contactTestNames: item.contactTestNames && item.contactTestNames !== ''
              ? item.contactTestNames.split('|')
              : [],
            requirementLinuxs: item.requirementLinuxs && item.requirementLinuxs !== ''
              ? item.requirementLinuxs.split('|')
              : [],
            startDate: item.createAt.split(" ")[0],
            endDate: item.endTime,
            remainingDays: 3,
            requirmentFatherStatus: item.requirmentFatherStatus,
            requirementCreateName: item.requirementCreateName,
            itemRequirementIsGetTest: item.itemRequirementIsGetTest,
          }
        ))// 按startDate倒序排序（字符串比较）
          .sort((c: any, d: any) => new Date(d.startDate).getTime() - new Date(c.startDate).getTime())
      }
    })
      .sort((a, b) => a.id - b.id);
    irList.value = irs
  }
}



// TODO 关闭分配弹窗
const handleCloseAssDialog = () => {
  avgRequirementFormData.length = 0;
  avgRequirementFormData.push({
    userUUID: "",
    guessTime: "",
    processJob: "",
    guessProcess: 1,
    processJobNum: 100,
  });

  tsRequirementFormData.length = 0;
  tsRequirementFormData.push({
    userUUID: "",
    guessTime: "",
    processJob: "",
    guessProcess: 1,
    processJobNum: 100,
  });
  dialogAvgVisible.value = false;
};

const avgRequirementFormData = reactive<any>([
  {
    userUUID: "",
    guessTime: "",
    processJob: "",
    guessProcess: 1,
    processJobNum: 100,
  },
]); // 已分配研发人员列表
const tsRequirementFormData = reactive<any>([
  {
    userUUID: "",
    guessTime: "",
    processJob: "",
    guessProcess: 1,
    processJobNum: 100,
  },
]); // 已分配测试人员列表


const getMemberTagType = (name: string) => {
  const firstChar = name.charCodeAt(0);
  // 根据姓名首字符的 ASCII 码来决定标签类型
  if (firstChar % 5 === 0) return 'success';
  if (firstChar % 5 === 1) return 'warning';
  if (firstChar % 5 === 2) return 'danger';
  if (firstChar % 5 === 3) return 'success';
  return '';
};
import { More, ArrowDown } from '@element-plus/icons-vue';
import { da } from 'element-plus/es/locale';
const filterTags = ref([
  { id: 1, name: '我负责的', active: true },
  { id: 2, name: '我参与的', active: false },
  { id: 3, name: '我关注的', active: false },
  { id: 4, name: '已超期', active: false },
  { id: 5, name: '即将到期', active: false },
]);
const toggleTag = (id: number) => {
  const tag = filterTags.value.find(t => t.id === id);
  if (tag) {
    tag.active = !tag.active;
  }
};

const actions = [
  { name: 'edit', label: '编辑', type: 'primary' },
  { name: 'delete', label: '删除', type: 'danger' },
  { name: 'transfer', label: '转交', type: '' },
  { name: 'comment', label: '评论', type: '' },
];
const dialogVisible = ref(false);
const dialogTitle = ref('');
const dialogWidth = ref('800px');
const dialogType = ref('');
const currentTask = ref<any>(null);
const currentStatusTasks = ref<any[]>([]);

const showStatusTasks = (status: any) => {
  dialogType.value = 'statusTasks';
  dialogTitle.value = status.name;
  dialogWidth.value = '1200px';
  currentStatusTasks.value = status.tasks;
  dialogVisible.value = true;
};
const showTaskDetail = (task: any) => {
  currentTask.value = task;
  dialogTitle.value = '任务详情';
  dialogWidth.value = '1000px';
  dialogType.value = 'taskDetail';
  dialogVisible.value = true;
};
// 是否显示结束时间
const isTimeForm = ref(false);
const handleAction = (action: string, task: any) => {
  currentTask.value = task;
  dialogType.value = action;
  itemRequirementId.value = task.id
  switch (action) {
    case 'avgTest':
      assignItems.value = [{
        role: '',
        participant: '',
        deadline: '',
        description: '',
        estimatedHours: 8,
        difficulty: 3
      }];
      getAllTestPersion('111|222|333|444|555|666|777|999')
      dialogTitle.value = '分配任务';
      dialogWidth.value = '1000px';
      dialogAvgVisible.value = true;
      // 是否显示决定结束时间
      if (task.requirementCreateName == "刘涛") {
        isTimeForm.value = true
      } else if (userAuthId.value == 555 || userAuthId.value == 888 || userAuthId.value == 999) {
        isTimeForm.value = true
      }

      break;
    case 'delete':
      dialogTitle.value = '删除任务';
      dialogWidth.value = '400px';
      break;
    case 'transfer':
      dialogTitle.value = '转交任务';
      dialogWidth.value = '500px';
      break;
    case 'comment':
      dialogTitle.value = '任务评论';
      dialogWidth.value = '600px';
      break;
  }
  // dialogVisible.value = true;
};
const availableLeaders = [
  '张伟峰', '林志明', '黄伟东', '章云飞', '郑明远',
  '刘志强', '孙宇轩', '吴志远', '陈天成', '赵思远'
];
const changeLeader = (taskId: number, newLeader: string) => {
  const task = statusList.value.flatMap(status => status.tasks).find(t => t.id === taskId);
  if (task) {
    task.members['技术负责人'] = [newLeader];
  }
};
const showMemberDetail = (member: string) => {
  currentTask.value = { name: member };
  dialogTitle.value = '成员详情';
  dialogWidth.value = '600px';
  dialogType.value = 'memberDetail';
  dialogVisible.value = true;
};
const handleDialogConfirm = () => {
  dialogVisible.value = false;
};


onMounted(async () => {
  GetAllInitRequirement();
  userAuthId.value = localStorage.getItem("authorityId")
});
</script>
<style scoped>
.el-input :deep(.el-input__wrapper) {
  border-radius: 8px;
  padding-left: 16px;
}

.el-dialog :deep(.el-dialog__header) {
  margin: 0;
  padding: 16px 24px;
  background-color: #f7f7f7;
  border-bottom: 1px solid #e5e7eb;
}

.el-dialog :deep(.el-dialog__footer) {
  margin: 0;
  padding: 16px 24px;
  background-color: #f7f7f7;
  border-top: 1px solid #e5e7eb;
}

.el-dialog :deep(.el-dialog__body) {
  padding: 24px;
}
</style>